package com.herench.bunch.exam.handler;


import com.alibaba.fastjson.JSON;
import com.herench.bunch.commons.annotation.Handler;
import com.herench.bunch.commons.support.AbstractMessageHandler;
import com.herench.bunch.exam.agent.ExamOperationAgent;
import com.herench.bunch.exam.convert.ExamApplicationConvert;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;


/**
 * @author luoxiaoming on 18-9-17 下午5:11
 * @email luoxiaoming@herench.com
 */

@Handler(code = "400020" ,name = "查询检查申请单" ,messageConvertClass = ExamApplicationConvert.class)
public class ExamApplicationHandler extends AbstractMessageHandler {

    @Autowired
    private ExamOperationAgent examOperationAgent;

    @Override
    protected Object proxyInvoke(Object inMessage) throws Exception {
        Map<String,Object> params = (Map<String, Object>) inMessage;
        List<Map<String,Object>> resList = examOperationAgent.application(params);
        String req = JSON.toJSONString(resList);
        return req;
    }
}